import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { MainComponent } from './main.component';
import { UserInfoResolver } from '../core/service/auth/auth.resolve.service';
import { XitongguanliComponent } from './xitongguanli/xitongguanli/xitongguanli.component';

const routes: Routes = [
	{
		path: '',
		component: MainComponent,
		children: [
			{
				path: 'prescriptions',
				loadChildren: './prescriptions/prescriptions.module#PrescriptionsModule',
				resolve: {
					user: UserInfoResolver
				}
			},
			{
				path: 'statistic-analysis',
				loadChildren: './statistic-analysis/statistic-analysis.module#StatisticAnalysisModule',
				resolve: {
					user: UserInfoResolver
				}
			},
			{
				path: 'basic-database',
				loadChildren: './basic-database/basic-database.module#BasicDatabaseModule',
				resolve: {
					user: UserInfoResolver
				}
			},
			// {
			// 	path: 'filelist',
			// 	loadChildren: 'app/suandao/main/filelist/filelist.module#FilelistModule'
			// },
			// {
			// 	path: '',
			// 	redirectTo: 'worktable',
			// 	pathMatch: 'full'
			// }
			{
				path: '',
				redirectTo: 'prescriptions',
				pathMatch: 'full'
			},
			{
				path: 'xitongguanli',
				component: XitongguanliComponent
			}
		]
	}
];

@NgModule({
	imports: [
		RouterModule.forChild(routes)
	],
	exports: [
		RouterModule
	]
})
export class MainRoutingModule {
	constructor() { }
}
